using System;
using System.Collections;
using System.Collections.Generic;


namespace NanoERP.Model
{
    /// <summary>
    /// 会计科目维护
    /// </summary>
    [Serializable]
    public sealed class Accountsubject
    {
        #region Private Members

        // Variabili di stato
        private bool _isChanged;

        // Primary Key(s) 
        private long _id;

        // Properties 
        private string _subjectno;
        private string _subjectname;
        private string _subjectpym;
        private long? _parentid;
        private decimal? _beginmoney;
        private decimal? _begininmoney;
        private decimal? _beginoutmoney;
        private decimal? _inmoney;
        private decimal? _outmoney;
        private decimal? _endmoney;
        private int? _isstandard;
        private int? _grade;
        private string _note;
        private int? _subjecttype;

        #endregion

        #region Default ( Empty ) Class Constructor

        /// <summary>
        /// default constructor
        /// </summary>
        public Accountsubject()
        {
            _id = 0;
            _subjectno = null;
            _subjectname = null;
            _subjectpym = null;
            _parentid = 0;
            _beginmoney = 0;
            _begininmoney = 0;
            _beginoutmoney = 0;
            _inmoney = 0;
            _outmoney = 0;
            _endmoney = 0;
            _isstandard = 0;
            _grade = null;
            _note = null;
            _subjecttype = null;
        }

        #endregion // End of Default ( Empty ) Class Constructor

        #region Full Constructor

        /// <summary>
        /// full constructor
        /// </summary>
        public Accountsubject(long id, string subjectno, string subjectname, string subjectpym, long? parentid, decimal? beginmoney, decimal? begininmoney, decimal? beginoutmoney, decimal? inmoney, decimal? outmoney, decimal? endmoney, int? isstandard, int? grade, string note, int? subjecttype)
        {
            _id = id;
            _subjectno = subjectno;
            _subjectname = subjectname;
            _subjectpym = subjectpym;
            _parentid = parentid;
            _beginmoney = beginmoney;
            _begininmoney = begininmoney;
            _beginoutmoney = beginoutmoney;
            _inmoney = inmoney;
            _outmoney = outmoney;
            _endmoney = endmoney;
            _isstandard = isstandard;
            _grade = grade;
            _note = note;
            _subjecttype = subjecttype;
        }

        #endregion // End Full Constructor

        #region Public Properties

        /// <summary>
        /// 主键
        /// </summary>		
        public long Id
        {
            get { return _id; }
            set { _isChanged |= (_id != value); _id = value; }
        }

        /// <summary>
        /// 科目编号
        /// </summary>		
        public string Subjectno
        {
            get { return _subjectno; }
            set
            {
                if (value != null)
                    if (value.Length > 50)
                        throw new ArgumentOutOfRangeException("Invalid value for Subjectno", value, value.ToString());

                _isChanged |= (_subjectno != value); _subjectno = value;
            }
        }

        /// <summary>
        /// 科目名称
        /// </summary>		
        public string Subjectname
        {
            get { return _subjectname; }
            set
            {
                if (value != null)
                    if (value.Length > 200)
                        throw new ArgumentOutOfRangeException("Invalid value for Subjectname", value, value.ToString());

                _isChanged |= (_subjectname != value); _subjectname = value;
            }
        }

        /// <summary>
        /// 助记码
        /// </summary>		
        public string Subjectpym
        {
            get { return _subjectpym; }
            set
            {
                if (value != null)
                    if (value.Length > 50)
                        throw new ArgumentOutOfRangeException("Invalid value for Subjectpym", value, value.ToString());

                _isChanged |= (_subjectpym != value); _subjectpym = value;
            }
        }

        /// <summary>
        /// 上级（父项）科目
        /// </summary>		
        public long? Parentid
        {
            get { return _parentid; }
            set { _isChanged |= (_parentid != value); _parentid = value; }
        }

        /// <summary>
        /// 期初金额
        /// </summary>		
        public decimal? Beginmoney
        {
            get { return _beginmoney; }
            set { _isChanged |= (_beginmoney != value); _beginmoney = value; }
        }

        /// <summary>
        /// 期初借方
        /// </summary>		
        public decimal? Begininmoney
        {
            get { return _begininmoney; }
            set { _isChanged |= (_begininmoney != value); _begininmoney = value; }
        }

        /// <summary>
        /// 期初贷方
        /// </summary>		
        public decimal? Beginoutmoney
        {
            get { return _beginoutmoney; }
            set { _isChanged |= (_beginoutmoney != value); _beginoutmoney = value; }
        }

        /// <summary>
        /// 借方金额
        /// </summary>		
        public decimal? Inmoney
        {
            get { return _inmoney; }
            set { _isChanged |= (_inmoney != value); _inmoney = value; }
        }

        /// <summary>
        /// 贷方金额
        /// </summary>		
        public decimal? Outmoney
        {
            get { return _outmoney; }
            set { _isChanged |= (_outmoney != value); _outmoney = value; }
        }

        /// <summary>
        /// 科目余额
        /// </summary>		
        public decimal? Endmoney
        {
            get { return _endmoney; }
            set { _isChanged |= (_endmoney != value); _endmoney = value; }
        }

        /// <summary>
        /// 是否标准科目  0-否，1-标准
        /// </summary>		
        public int? Isstandard
        {
            get { return _isstandard; }
            set { _isChanged |= (_isstandard != value); _isstandard = value; }
        }

        /// <summary>
        /// 科目所在层级 在第一级为0
        /// </summary>		
        public int? Grade
        {
            get { return _grade; }
            set { _isChanged |= (_grade != value); _grade = value; }
        }

        /// <summary>
        /// 备注
        /// </summary>		
        public string Note
        {
            get { return _note; }
            set
            {
                if (value != null)
                    if (value.Length > 100)
                        throw new ArgumentOutOfRangeException("Invalid value for Note", value, value.ToString());

                _isChanged |= (_note != value); _note = value;
            }
        }

        /// <summary>
        /// 科目类型
        /// </summary>		
        public int? Subjecttype
        {
            get { return _subjecttype; }
            set { _isChanged |= (_subjecttype != value); _subjecttype = value; }
        }

        #endregion

    }
}